package co.edu.udistrital.audiomixer;

import java.util.List;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.texo.model.AbstractModelFeatureMapEntry;
import org.eclipse.emf.texo.model.AbstractModelObject;
import org.eclipse.emf.texo.model.ModelFactory;
import org.eclipse.emf.texo.model.ModelFeatureMapEntry;
import org.eclipse.emf.texo.model.ModelObject;
import org.eclipse.emf.texo.model.ModelPackage;
import co.edu.udistrital.audiomixer.entidad.Composicion;
import co.edu.udistrital.audiomixer.entidad.Pista;
import co.edu.udistrital.audiomixer.entidad.Proyecto;
import co.edu.udistrital.audiomixer.entidad.Usuario;

/**
 * The <b>{@link ModelFactory}</b> for the types of this model: audiomixer. It
 * contains code to create instances {@link ModelObject} wrappers and instances
 * for EClasses and convert objects back and forth from their String (XML)
 * representation. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
 * begin-model-doc -->
 * 
 * <!-- end-model-doc -->
 * 
 * @generated
 */
public class AudiomixerModelFactory implements ModelFactory {

	/**
	 * Creates an instance for an {@link EClass} <!-- begin-user-doc --> <!--
	 * end-user-doc -->
	 * 
	 * @param eClass
	 *            creates a Object instance for this EClass
	 * @return an object representing the eClass
	 * @generated
	 */
	public Object create(EClass eClass) {
		switch (eClass.getClassifierID()) {
		case AudiomixerModelPackage.COMPOSICION_CLASSIFIER_ID:
			return createComposicion();
		case AudiomixerModelPackage.USUARIO_CLASSIFIER_ID:
			return createUsuario();
		case AudiomixerModelPackage.PROYECTO_CLASSIFIER_ID:
			return createProyecto();
		case AudiomixerModelPackage.PISTA_CLASSIFIER_ID:
			return createPista();
		default:
			throw new IllegalArgumentException("The EClass '"
					+ eClass.getName()
					+ "' is not a valid EClass for this EPackage");
		}
	}

	/**
	 * Wraps an object in a {@link ModelObject}. <!-- begin-user-doc --> <!--
	 * end-user-doc -->
	 * 
	 * @param eClass
	 *            the EClass of the object
	 * @param adaptee
	 *            the object being wrapped/adapted
	 * @return the wrapper {@link ModelObject}
	 * @generated
	 */
	@SuppressWarnings({ "unchecked", "rawtypes" })
	public ModelObject createModelObject(EClass eClass, Object adaptee) {
		ModelObject<Object> modelObject = null;
		switch (eClass.getClassifierID()) {
		case AudiomixerModelPackage.COMPOSICION_CLASSIFIER_ID:
			modelObject = new ComposicionModelObject();
			break;
		case AudiomixerModelPackage.USUARIO_CLASSIFIER_ID:
			modelObject = new UsuarioModelObject();
			break;
		case AudiomixerModelPackage.PROYECTO_CLASSIFIER_ID:
			modelObject = new ProyectoModelObject();
			break;
		case AudiomixerModelPackage.PISTA_CLASSIFIER_ID:
			modelObject = new PistaModelObject();
			break;
		default:
			throw new IllegalArgumentException("The EClass '" + eClass
					+ "' is not defined in this EPackage");
		}
		modelObject.setTarget(adaptee);
		return modelObject;
	}

	/**
	 * Creates a feature map entry instance for a certain EStructuralFeature.
	 * 
	 * @param eFeature
	 *            the feature map feature
	 * @return the pojo feature map entry
	 * @generated
	 */
	public Object createFeatureMapEntry(EStructuralFeature eFeature) {
		throw new IllegalArgumentException("The EStructuralFeature '"
				+ eFeature + "' is not a valid feature map in this EPackage");
	}

	/**
	 * Wraps a feature map entry pojo in a {@link AbstractModelFeatureMapEntry}.
	 * If the feature map entry is null then a new one is created and <!--
	 * begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @param eFeature
	 *            the feature map feature of the object
	 * @param adaptee
	 *            the pojo feature map entry being wrapped/adapted
	 * @return the wrapper {@link ModelFeatureMapEntry}
	 * @generated
	 */
	public ModelFeatureMapEntry<?> createModelFeatureMapEntry(
			EStructuralFeature eFeature, Object adaptee) {
		throw new IllegalArgumentException("The EStructuralFeature '"
				+ eFeature + "' is not a valid feature map in this EPackage");
	}

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @return an instance of the model object representing the EClass
	 *         Composicion
	 * @generated
	 */
	public Composicion createComposicion() {
		return new Composicion();
	}

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @return an instance of the model object representing the EClass Usuario
	 * @generated
	 */
	public Usuario createUsuario() {
		return new Usuario();
	}

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @return an instance of the model object representing the EClass Proyecto
	 * @generated
	 */
	public Proyecto createProyecto() {
		return new Proyecto();
	}

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @return an instance of the model object representing the EClass Pista
	 * @generated
	 */
	public Pista createPista() {
		return new Pista();
	}

	/**
	 * Converts an instance of an {@link EDataType} to a String. <!--
	 * begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @param eDataType
	 *            the {@link EDataType} defining the type
	 * @param value
	 *            the object to convert, if the value is null then null is
	 *            returned.
	 * @generated
	 */
	public Object createFromString(EDataType eDataType, String value) {
		switch (eDataType.getClassifierID()) {
		default:
			throw new IllegalArgumentException("The EDatatype '" + eDataType
					+ "' is not defined in this EPackage");
		}
	}

	/**
	 * Converts an instance of an {@link EDataType} to a String. <!--
	 * begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @param eDataType
	 *            the {@link EDataType} defining the type
	 * @param value
	 *            the object to convert, if value == null then null is returned
	 * @generated
	 */
	public String convertToString(EDataType eDataType, Object value) {
		switch (eDataType.getClassifierID()) {
		default:
			throw new IllegalArgumentException("The EDatatype '" + eDataType
					+ "' is not defined in this EPackage.");
		}
	}

	/**
	 * The adapter/wrapper for the EClass '<em><b>Composicion</b></em>'.
	 * 
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @param <E>
	 *            the domain model java class
	 * 
	 * @generated
	 */
	public static class ComposicionModelObject<E extends Composicion> extends
			AbstractModelObject<E> {
		/**
		 * @generated
		 */
		public EClass eClass() {
			return AudiomixerModelPackage.INSTANCE.getComposicionEClass();
		}

		/**
		 * @generated
		 */
		public ModelPackage getModelPackage() {
			return AudiomixerModelPackage.INSTANCE;
		}

		/**
		 * @generated
		 */
		@Override
		public Object eGet(EStructuralFeature eStructuralFeature) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {
			case AudiomixerModelPackage.COMPOSICION_USUARIOS_FEATURE_ID:
				return getTarget().getUsuarios();
			case AudiomixerModelPackage.COMPOSICION_ID_FEATURE_ID:
				return getTarget().getId();
			case AudiomixerModelPackage.COMPOSICION_NOMBRE_FEATURE_ID:
				return getTarget().getNombre();
			default:
				return super.eGet(eStructuralFeature);
			}
		}

		/**
		 * @generated
		 */
		@SuppressWarnings("unchecked")
		@Override
		public void eSet(EStructuralFeature eStructuralFeature, Object value) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {
			case AudiomixerModelPackage.COMPOSICION_USUARIOS_FEATURE_ID:
				getTarget().setUsuarios((List<Usuario>) value);
				return;
			case AudiomixerModelPackage.COMPOSICION_ID_FEATURE_ID:
				getTarget().setId((Integer) value);
				return;
			case AudiomixerModelPackage.COMPOSICION_NOMBRE_FEATURE_ID:
				getTarget().setNombre((String) value);
				return;
			default:
				super.eSet(eStructuralFeature, value);
			}
		}

		/**
		 * @generated
		 */
		@Override
		public void eAddTo(EStructuralFeature eStructuralFeature, Object value) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {

			case AudiomixerModelPackage.COMPOSICION_USUARIOS_FEATURE_ID:
				getTarget().getUsuarios().add((Usuario) value);
				return;

			default:
				super.eAddTo(eStructuralFeature, value);
			}
		}

		/**
		 * @generated
		 */
		@Override
		public void eRemoveFrom(EStructuralFeature eStructuralFeature,
				Object value) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {

			case AudiomixerModelPackage.COMPOSICION_USUARIOS_FEATURE_ID:
				getTarget().getUsuarios().remove(value);
				return;

			default:
				super.eRemoveFrom(eStructuralFeature, value);
			}
		}
	}

	/**
	 * The adapter/wrapper for the EClass '<em><b>Usuario</b></em>'.
	 * 
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @param <E>
	 *            the domain model java class
	 * 
	 * @generated
	 */
	public static class UsuarioModelObject<E extends Usuario> extends
			AbstractModelObject<E> {
		/**
		 * @generated
		 */
		public EClass eClass() {
			return AudiomixerModelPackage.INSTANCE.getUsuarioEClass();
		}

		/**
		 * @generated
		 */
		public ModelPackage getModelPackage() {
			return AudiomixerModelPackage.INSTANCE;
		}

		/**
		 * @generated
		 */
		@Override
		public Object eGet(EStructuralFeature eStructuralFeature) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {
			case AudiomixerModelPackage.USUARIO_ID_FEATURE_ID:
				return getTarget().getId();
			case AudiomixerModelPackage.USUARIO_IDENTIFICACION_FEATURE_ID:
				return getTarget().getIdentificacion();
			case AudiomixerModelPackage.USUARIO_PASSWORD_FEATURE_ID:
				return getTarget().getPassword();
			case AudiomixerModelPackage.USUARIO_PROYECTOS_FEATURE_ID:
				return getTarget().getProyectos();
			case AudiomixerModelPackage.USUARIO_NOMBRE_FEATURE_ID:
				return getTarget().getNombre();
			case AudiomixerModelPackage.USUARIO_CORREO_FEATURE_ID:
				return getTarget().getCorreo();
			default:
				return super.eGet(eStructuralFeature);
			}
		}

		/**
		 * @generated
		 */
		@SuppressWarnings("unchecked")
		@Override
		public void eSet(EStructuralFeature eStructuralFeature, Object value) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {
			case AudiomixerModelPackage.USUARIO_ID_FEATURE_ID:
				getTarget().setId((Integer) value);
				return;
			case AudiomixerModelPackage.USUARIO_IDENTIFICACION_FEATURE_ID:
				getTarget().setIdentificacion((String) value);
				return;
			case AudiomixerModelPackage.USUARIO_PASSWORD_FEATURE_ID:
				getTarget().setPassword((String) value);
				return;
			case AudiomixerModelPackage.USUARIO_PROYECTOS_FEATURE_ID:
				getTarget().setProyectos((List<Proyecto>) value);
				return;
			case AudiomixerModelPackage.USUARIO_NOMBRE_FEATURE_ID:
				getTarget().setNombre((String) value);
				return;
			case AudiomixerModelPackage.USUARIO_CORREO_FEATURE_ID:
				getTarget().setCorreo((String) value);
				return;
			default:
				super.eSet(eStructuralFeature, value);
			}
		}

		/**
		 * @generated
		 */
		@Override
		public void eAddTo(EStructuralFeature eStructuralFeature, Object value) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {

			case AudiomixerModelPackage.USUARIO_PROYECTOS_FEATURE_ID:
				getTarget().getProyectos().add((Proyecto) value);
				return;

			default:
				super.eAddTo(eStructuralFeature, value);
			}
		}

		/**
		 * @generated
		 */
		@Override
		public void eRemoveFrom(EStructuralFeature eStructuralFeature,
				Object value) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {

			case AudiomixerModelPackage.USUARIO_PROYECTOS_FEATURE_ID:
				getTarget().getProyectos().remove(value);
				return;

			default:
				super.eRemoveFrom(eStructuralFeature, value);
			}
		}
	}

	/**
	 * The adapter/wrapper for the EClass '<em><b>Proyecto</b></em>'.
	 * 
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @param <E>
	 *            the domain model java class
	 * 
	 * @generated
	 */
	public static class ProyectoModelObject<E extends Proyecto> extends
			AbstractModelObject<E> {
		/**
		 * @generated
		 */
		public EClass eClass() {
			return AudiomixerModelPackage.INSTANCE.getProyectoEClass();
		}

		/**
		 * @generated
		 */
		public ModelPackage getModelPackage() {
			return AudiomixerModelPackage.INSTANCE;
		}

		/**
		 * @generated
		 */
		@Override
		public Object eGet(EStructuralFeature eStructuralFeature) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {
			case AudiomixerModelPackage.PROYECTO_ID_FEATURE_ID:
				return getTarget().getId();
			case AudiomixerModelPackage.PROYECTO_NOMBRE_FEATURE_ID:
				return getTarget().getNombre();
			case AudiomixerModelPackage.PROYECTO_COMPASNUMERADOR_FEATURE_ID:
				return getTarget().getCompasNumerador();
			case AudiomixerModelPackage.PROYECTO_COMPASDENOMINADOR_FEATURE_ID:
				return getTarget().getCompasDenominador();
			case AudiomixerModelPackage.PROYECTO_PISTAS_FEATURE_ID:
				return getTarget().getPistas();
			case AudiomixerModelPackage.PROYECTO_USUARIOSPROYECTO_FEATURE_ID:
				return getTarget().getUsuariosProyecto();
			default:
				return super.eGet(eStructuralFeature);
			}
		}

		/**
		 * @generated
		 */
		@SuppressWarnings("unchecked")
		@Override
		public void eSet(EStructuralFeature eStructuralFeature, Object value) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {
			case AudiomixerModelPackage.PROYECTO_ID_FEATURE_ID:
				getTarget().setId((Integer) value);
				return;
			case AudiomixerModelPackage.PROYECTO_NOMBRE_FEATURE_ID:
				getTarget().setNombre((String) value);
				return;
			case AudiomixerModelPackage.PROYECTO_COMPASNUMERADOR_FEATURE_ID:
				getTarget().setCompasNumerador((Integer) value);
				return;
			case AudiomixerModelPackage.PROYECTO_COMPASDENOMINADOR_FEATURE_ID:
				getTarget().setCompasDenominador((Integer) value);
				return;
			case AudiomixerModelPackage.PROYECTO_PISTAS_FEATURE_ID:
				getTarget().setPistas((List<Pista>) value);
				return;
			case AudiomixerModelPackage.PROYECTO_USUARIOSPROYECTO_FEATURE_ID:
				getTarget().setUsuariosProyecto((List<Usuario>) value);
				return;
			default:
				super.eSet(eStructuralFeature, value);
			}
		}

		/**
		 * @generated
		 */
		@Override
		public void eAddTo(EStructuralFeature eStructuralFeature, Object value) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {

			case AudiomixerModelPackage.PROYECTO_PISTAS_FEATURE_ID:
				getTarget().getPistas().add((Pista) value);
				return;

			case AudiomixerModelPackage.PROYECTO_USUARIOSPROYECTO_FEATURE_ID:
				getTarget().getUsuariosProyecto().add((Usuario) value);
				return;
			default:
				super.eAddTo(eStructuralFeature, value);
			}
		}

		/**
		 * @generated
		 */
		@Override
		public void eRemoveFrom(EStructuralFeature eStructuralFeature,
				Object value) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {

			case AudiomixerModelPackage.PROYECTO_PISTAS_FEATURE_ID:
				getTarget().getPistas().remove(value);
				return;

			case AudiomixerModelPackage.PROYECTO_USUARIOSPROYECTO_FEATURE_ID:
				getTarget().getUsuariosProyecto().remove(value);
				return;
			default:
				super.eRemoveFrom(eStructuralFeature, value);
			}
		}
	}

	/**
	 * The adapter/wrapper for the EClass '<em><b>Pista</b></em>'.
	 * 
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @param <E>
	 *            the domain model java class
	 * 
	 * @generated
	 */
	public static class PistaModelObject<E extends Pista> extends
			AbstractModelObject<E> {
		/**
		 * @generated
		 */
		public EClass eClass() {
			return AudiomixerModelPackage.INSTANCE.getPistaEClass();
		}

		/**
		 * @generated
		 */
		public ModelPackage getModelPackage() {
			return AudiomixerModelPackage.INSTANCE;
		}

		/**
		 * @generated
		 */
		@Override
		public Object eGet(EStructuralFeature eStructuralFeature) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {
			case AudiomixerModelPackage.PISTA_ID_FEATURE_ID:
				return getTarget().getId();
			case AudiomixerModelPackage.PISTA_DESCRIPCION_FEATURE_ID:
				return getTarget().getDescripcion();
			case AudiomixerModelPackage.PISTA_FUENTE_FEATURE_ID:
				return getTarget().getFuente();
			case AudiomixerModelPackage.PISTA_VOLUMEN_FEATURE_ID:
				return getTarget().getVolumen();
			case AudiomixerModelPackage.PISTA_GANANCIA_FEATURE_ID:
				return getTarget().getGanancia();
			case AudiomixerModelPackage.PISTA_ORDEN_FEATURE_ID:
				return getTarget().getOrden();
			case AudiomixerModelPackage.PISTA_TIEMPO_FEATURE_ID:
				return getTarget().getTiempo();
			case AudiomixerModelPackage.PISTA_TIEMPOINICIO_FEATURE_ID:
				return getTarget().getTiempoInicio();
			case AudiomixerModelPackage.PISTA_USUARIOCARGA_FEATURE_ID:
				return getTarget().getUsuarioCarga();
			default:
				return super.eGet(eStructuralFeature);
			}
		}

		/**
		 * @generated
		 */
		@Override
		public void eSet(EStructuralFeature eStructuralFeature, Object value) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {
			case AudiomixerModelPackage.PISTA_ID_FEATURE_ID:
				getTarget().setId((Integer) value);
				return;
			case AudiomixerModelPackage.PISTA_DESCRIPCION_FEATURE_ID:
				getTarget().setDescripcion((String) value);
				return;
			case AudiomixerModelPackage.PISTA_FUENTE_FEATURE_ID:
				getTarget().setFuente((String) value);
				return;
			case AudiomixerModelPackage.PISTA_VOLUMEN_FEATURE_ID:
				getTarget().setVolumen((Integer) value);
				return;
			case AudiomixerModelPackage.PISTA_GANANCIA_FEATURE_ID:
				getTarget().setGanancia((Integer) value);
				return;
			case AudiomixerModelPackage.PISTA_ORDEN_FEATURE_ID:
				getTarget().setOrden((Integer) value);
				return;
			case AudiomixerModelPackage.PISTA_TIEMPO_FEATURE_ID:
				getTarget().setTiempo((Long) value);
				return;
			case AudiomixerModelPackage.PISTA_TIEMPOINICIO_FEATURE_ID:
				getTarget().setTiempoInicio((Long) value);
				return;
			case AudiomixerModelPackage.PISTA_USUARIOCARGA_FEATURE_ID:
				getTarget().setUsuarioCarga((Usuario) value);
				return;
			default:
				super.eSet(eStructuralFeature, value);
			}
		}

		/**
		 * @generated
		 */
		@Override
		public void eAddTo(EStructuralFeature eStructuralFeature, Object value) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {

			default:
				super.eAddTo(eStructuralFeature, value);
			}
		}

		/**
		 * @generated
		 */
		@Override
		public void eRemoveFrom(EStructuralFeature eStructuralFeature,
				Object value) {
			final int featureID = eClass().getFeatureID(eStructuralFeature);
			switch (featureID) {

			default:
				super.eRemoveFrom(eStructuralFeature, value);
			}
		}
	}
}